package com.gzk.oeno.business.compare;

import java.util.Comparator;

import com.gzk.oeno.business.codif.CodifVin;
import com.gzk.oeno.tech.set.IdPair;

public class CodifComparator implements Comparator<IdPair<CodifVin, String>>{

	private final NameComparator nameComparator = new NameComparator();
	
	@Override
	public int compare(IdPair<CodifVin, String> o1, IdPair<CodifVin, String> o2) {
		if (o1 == null && o2 == null)
			return 0;
		if (o1 == null)
			return 1;
		if (o2 == null)
			return -1;
		return nameComparator.compare(o1.getFirst(), o2.getFirst());
	}

}
